home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group97a.txt / 000059_icon-group-sender _Mon Mar 3 12:56:34 1997.msg < prev    next >
Internet Message Format  |  2000-09-20  |  8KB

  1. Received: by cheltenham.cs.arizona.edu; Mon, 3 Mar 1997 13:02:08 MST
  2. Message-Id: <199703031852.AA05027@optima.cs.arizona.edu>
  3. X-Sender: lindsay@mail.rmc.ca
  4. X-Mailer: Windows Eudora Light Version 1.5.2
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset="us-ascii"
  7. Date: Mon, 03 Mar 1997 12:56:34 -0500
  8. To: jan@solstice.digicomp.com (Jan Galkowski), icon-group@cs.arizona.edu,
  9.         jtgalkowski@worldnet.att.net
  10. From: "John H. Lindsay" <lindsay_j@rmc.ca>
  11. Subject: Re: "Re: Icon and two-dimensional matching
  12. Errors-To: icon-group-errors@cs.arizona.edu
  13. Status: RO
  14. Content-Length: 7649
  15.  
  16. At 11:51 1997 02 28 -0500, you wrote:
  17. >
  18. >On Fri, 28 Feb 1997 09:45:54 -0500 John H. Lindsay" 
  19. ><lindsay_j@rmc.ca> wrote
  20.  
  21. >>...  big snip ...
  22. >
  23. >>You (and at least one other poster) rightly point out the nicities and 
  24. >>problems related to 2-dimensional extensions.  In the same vein, 
  25. >>I'll drop back to 1-dimensional ideas.
  26. >
  27. >I hope you have posted this response out to comp.lang.icon.  I didn't
  28. >see it there.  Actually, I didn't even see this other post that addressed
  29. >2-dimensional extensions.  Newsgroups are funny things.  If you could,
  30. >might you send me a copy of this other post?  Thanks.  Sounds 
  31. >interesting.
  32.  
  33. I've just about finished reorganizing my machine, partly due to 
  34. hardware problems, and partly due to a major reorganization of the 
  35. college's net access; I have e-mail back, but not a news reader just 
  36. yet.  I received your message via e-mail since I'm on the Icon 
  37. mailing list.  I've copied my original e-mail for you to the news 
  38. group, and added the news group address to this message.  The 
  39. other message was the one by Mark Espie; let me know if you 
  40. didn't see it.  I think posts to the news group are turned around 
  41. quite automatically to the mailing list, but appearance on the news
  42. group may take quite a bit longer.
  43.  
  44. >>It has bothered me for a long time that the idea of _string_ has 
  45. >>only been applied to single characters in icon and many other 
  46. >>languages.  
  47.  
  48.  ... snip ...
  49.  
  50. >    Could you explain this part a little better?  It seemed to run on.
  51.  
  52. There are only a couple of character string operators that are generally 
  53. implemented, concatenation and extraction of a copy of a substring.  
  54. SNOBOL4, and to a lesser extent, Icon, add pattern matching with 
  55. picking out values of simple or complex parts of the string as matched 
  56. by patterns.  I find it a matter of assymetry that (1) many other languages 
  57. don't have strings of anything other than characters, (2) while Icon has 
  58. lists, they are different from strings (a list of characters is different from 
  59. a character string), lists have a different concatenation operator, but the 
  60. same element and substring selectors, and they don't have pattern 
  61. matching, and (3) where languages have ways of treating variables, 
  62. values and expressions, these are usually not propagated to strings 
  63. of any sort.  
  64.  
  65. Of note is the ability of some languages to treat a portion of an agregate 
  66. or of an apparently indivisible thing like a file variable as if it were a
  67. variable - a pseudovariable.  In some cases this creates access to 
  68. otherwise inaccessible things, the status of a file, the ability to terminate 
  69. a task by setting the completion status of a task variable, or the current 
  70. dimensions of a conformant array parameter in ISO Extended Pascal. 
  71.  In other cases, this both creates a problem in that there is more than 
  72. one way to address an area of storage (with problems for some (all?) 
  73. programmers ensuing), and also creates a necessary way to do some 
  74. necessary things like treat a diagonal or column of a vector of a matrix 
  75. as a vector in its own right.  Slices or cross-sections of arrays in Algol
  76. 68 are a case in point; these may be written easily and assigned to IN SITU 
  77. as if they were variables so that the host array has its values changed. 
  78. Cross-sections may be passed to routines as arrays.  There may be 
  79. some restrictions on what one can do with a pseudovarible - one might 
  80. resize an array, but would not attempt to resize a cross-section since 
  81. this would do violence to the host array, or be a meaningless operation.  
  82.  
  83. Icon and SNOBOL emphasize handling values rather than references 
  84. although there are 'name' operators, and don't handle sub-arrays,
  85. substrings or sublists as pseudovariables.  
  86.  
  87. For my work, I'd really like to be able to define methods of handling 
  88. sub(structures | strings | arrays) as structures, strings, or arrays.  
  89. A few of these things are available in Icon, and the rest aren't.  I need 
  90. to be able to do things like do pattern matching on the output of a 
  91. generator, where the generator might yield a stream of characters or a
  92. stream of other sorts of things -- tokens.  This means defining new 
  93. operators or extending the meaning of existing operators to new types 
  94. of data or to new semantic situations.
  95.  
  96. I'm interested in generalized macro processing, where the macro 
  97. processing becomes a method - a dynamic method - of program 
  98. language development, and that plays just as much a part in program 
  99. development as algorithm design, module design and data structure
  100. design.  One specifies the TRANSLATION of algorithms, data 
  101. specifications, ... into code.  Previous passes over the text or previous 
  102. work in the same pass where rescanning is allowed, besides perhaps 
  103. transforming the text, may decorate it with tokens (roughtly, a structure 
  104. containing a source string and other information), or with trees or with 
  105. other structures and with other information.  Then one has to recognize 
  106. patterns among the tag-along information and source text, and to 
  107. process it both by generating new information and transforming the 
  108. structures and data that exist.
  109.  
  110. >   If I understand correctly, what you're going after is something like
  111. >being able to bind arbitrary portions of what we call "strings" with
  112. >procedural packages.  I'm thinking of something like currying functions
  113. >in the lambda calculus with pieces of "unevaluated" strings and being
  114. >able to splice these critters in freely amongst the characters.  Am I
  115. >off?
  116.  
  117. Generally, I try to avoid deeper aspects of formal logic, so I'm guessing 
  118. here; you've got most of it, I think.
  119.  
  120. >>The worst part is that, currently, Icon lacks anything like SNOBOL4's 
  121. >>OPSYN that can be used to give unused unary prefix or binary infix 
  122. >>operators a meaning or a new meaning.  
  123.  
  124.  ... snip ...
  125.  
  126. >  I knew SNOBOL4 some time ago, but I forget what OPSYN does.
  127. >In your post to the comp.lang.icon, could you describe these and other
  128. >features of Icon?  Not everyone who comes to and uses Icon came
  129. >there from SNOBOL4.
  130.  
  131. OPSYN is a function that assigns an existing function name or operator 
  132. as the meaning of a name or operator.  One can overload an operator by 
  133. saving the meaning of an operator, and then assigning the operator to a
  134. routine containing a test of the data type of the arguments to determine 
  135. whether to apply the old operator meaning, or use the new meaning.
  136.  
  137.  ... snip ...
  138.  
  139. >   Well, I suppose it depends upon what one means by functions.  To
  140. >me, an operator or functional is simply a curried version of a multiple
  141. >parameter function, assuming functions have full rights as they should,
  142. >and as they do in Icon, and Edison, for example.
  143.  
  144. Right.  I don't know Edison; do you have a reference ? 
  145.  
  146. >>For this type of end, I'd love to see the ability in Icon to create new 
  147. >>operators, and to extend and to redefine existing operators.  
  148.  
  149.  ... snip ...
  150.  
  151. >  Hmmm.  Why couldn't one define a series of unbounded-number-of-
  152. >arguments procedures which picked up their "actual" parameters by
  153. >pattern matching in the immediate context of their being called?  That is,
  154. >why wouldn't the same be achieved by building pattern matching into
  155. >the parameter passing mechanism, something which could be 
  156. >implemented on a procedure by procedure case?  One wouldn't 
  157. >want the overhead of pattern matching in each and every instance,
  158. >true?
  159.  
  160. ?????  I'll think about this one.
  161. >
  162. >Have a great weekend,
  163. >
  164. >  Jan Galkowski.
  165.  
  166. Thanks, it was; I hope yours was great as well.
  167. All the best !
  168.  
  169. John H. Lindsay, Assistant Professor,
  170. DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE
  171. ROYAL MILITARY COLLEGE OF CANADA
  172. PO BOX 17000  STN FORCES
  173. KINGSTON  ON   K7K7B4
  174.